import 'babel-polyfill'
import 'url-search-params-polyfill';
import Vue from 'vue'
import axios from '@/plugins/axios'
import App from './App.vue'
import router from './router'
import 'element-ui/lib/theme-chalk/index.css';
import "@/assets/icon/iconfont.css";
import "@/assets/css/commom.scss";
import ElementUI from 'element-ui';
import store from './store'
import common from  '@/plugins/common';
import tree from '@/components/tree/index'
import '@/plugins/permission'

Vue.config.productionTip = false;
Vue.prototype.$axios = axios;
Vue.prototype.$common = common;


// 增加 el-button防抖自定义指令
Vue.directive('preventReClick', {
  inserted(el, binding) {
    el.addEventListener('click', () => {
      if (!el.disabled) {
        el.disabled = true
        setTimeout(() => {
          el.disabled = false
        }, binding.value || 2000)
      }
    })
  }
});



Vue.use(ElementUI);
Vue.use(tree);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
